# from pydub import silence
# from pydub import AudioSegment
#
# # 初始化
# audio_path = "audio/chunks/bu.wav"
# # aduio_out_Path = "./audio_out/"
# audio_type = 'wav'
#
# # 读入音频
# print('读入音频')
# sound = AudioSegment.from_file(audio_path, format=audio_type)
# nsltRange = silence.detect_nonsilent(sound, min_silence_len=10, silence_thresh=-80)
#
# print(nsltRange)
# temp_music = AudioSegment.silent(duration=10)
# for _ in nsltRange:
#     i, j = tuple(_)
#     temp_music += sound[i:j]
# sound = temp_music
# sound.export("audio/testout.wav", format='wav')

# allVowels = '''
# a ā i ī u ū e o aṃ āṃ iṃ īṃ uṃ ūṃ eṃ oṃ
# aṅ āṅ iṅ īṅ uṅ ūṅ eṅ oṅ añ āñ iñ īñ uñ ūñ
# eñ oñ aṇ āṇ iṇ īṇ uṇ ūṇ eṇ oṇ an ān in īn
#  un ūn en on am ām im īm um ūm em om'''
# pureVowels = allVowels.split()
# print(pureVowels)


import os


from playsound import playsound

# Paliwords = 'ā'
# try:
#     playsound("./audio/words/%s.wav" % Paliwords)
# except BaseException:
#     print("播放 audio/words/%s.wav 失败，正在尝试使用本地播放器打开音频" % Paliwords)
#     os.startfile(os.getcwd() + "audio\\words\\%s.wav" % Paliwords)


print(os.getcwd())
#
# os.startfile('D:\\pyHome\\PaliReader\\audio\\words\\ā.wav')
